{include file="common/head"}
<head>
<title>员工入职登记</title>

<style type="text/css">
  .row{margin: 10px 0;}
  label{width: 18%;display: inline-block;}
  .form-control{display:inline-block;width: 80%;}  
</style>
</head>
<body style="">
    <div class="container p-3 my-3 " style="max-width: 600px;"  >
    <h2>员工入职登记</h2>
    
    <form method="post" action="/index.php/user/user_add">
      <div class="row">
        <div class="col-2" >部门:</div>
        <div class="col-10">
          <select id="dept_id" name="dept_id" class="form-control">
              {foreach $dept as $k=>$v}
                  <option value="{$k}" >{$v['name']}</option>
              {/foreach}
          </select>
        </div>
      </div>

<!--       <div class="row">
        <div class="col-2" >职务级别:</div>
        <div class="col-10">
        <select id="level" name="level" class="form-control">
            {foreach $levels as $k=>$v}
                <option value="{$k}" >{$v}</option>
            {/foreach}
        </select>
        </div>
      </div>  --> 

<!--       <div class="row">
        <div class="col-2">权限组:</div>
        <div class="col-10">
        <select id="group_id" name="group_id" class="form-control">
            {foreach $group as $k=>$v}
                <option value="{$k}" >{$v['name']}</option>
            {/foreach}
        </select>
        </div>
      </div>  -->
      <hr/>      
      <div class="row">
        <div class="col-2">工号:</div>
        <div class="col-10">
          <input type="text" class="form-control" id="uid" name="uid" value="" placeholder="工号(登录帐号)" />
        </div>
      </div>

      <div class="row">
        <div class="col-2">姓名:</div>
        <div class="col-10">
        <input type="text" class="form-control" id="name" name="name" value="" placeholder="姓名" />
        </div>
      </div>

      <div class="row">
        <div class="col-2">身份证号:</div>
        <div class="col-10">
          <input type="text" class="form-control" id="id_card" name="id_card" value="" placeholder="身份证号码" />
        </div>
      </div>   

      <div class="row">
        <div class="col-2">居住地址:</div>
        <div class="col-10">
        <input type="text" class="form-control" id="address" name="address" value="" placeholder="居住地址" />
      </div>
      </div>
      <div class="row">
        <div class="col-2">手机号码:</div>
        <div class="col-10">
        <input type="text" class="form-control" id="mobile" name="mobile" value="" placeholder="手机号码" />
      </div>
      </div>
      <div class="row">
        <div class="col-2">微信号码:</div>
        <div class="col-10">
        <input type="text" class="form-control" id="wx" name="wx" value="" placeholder="微信号码" />
      </div>
      </div>      

      <div class="row">
        <div class="col-2">性别:</div>
        <div class="col-10">
          <input type="radio" class="form-check-input" id="radio1" name="sex" value="1"  checked /> 
          <label class="form-check-label" for="radio1">男(Man)</label>
          <input type="radio" class="form-check-input" id="radio2" name="sex" value="2" />
          <label class="form-check-label" for="radio2">女(Female)</label>
        </div>
      </div>

      <div class="row">
        <div class="col-2">是否在职:</div>
        <div class="col-10">
          <input type="radio" class="form-check-input" id="radio3" name="status" value="1"  checked /> 
          <label class="form-check-label" for="radio3">在职</label>
          <input type="radio" class="form-check-input" id="radio4" name="status" value="2" />
          <label class="form-check-label" for="radio4">离职</label>
          <input type="radio" class="form-check-input" id="radio5" name="status" value="3" />
          <label class="form-check-label" for="radio5">黑名单</label>        
          </div>  
       </div>

      <button  type="button" class="btn btn-primary" onclick="doSave()">保存员工资料</button>

    </form>
    </div>

<script type="text/javascript">
    function doSave(){
      if(!$("#uid").val()) {
        layer.msg("无效的工号!");
        return 0;
      } 
      if(!$("#name").val()) {
        layer.msg("无效的姓名!");
        return 0;
      } 
      if(!$("#dept_id").val()) {
        layer.msg("请选择部门!");
        return 0;
      } 
      if(!$("#level").val()) {
        layer.msg("请选择职务级别!");
        return 0;
      }       

           //询问框
      layer.confirm('是否确定保存?', {
        btn: ['YES','CANCEL'] //按钮
      }, function(){
        $('form').submit();
      }, function(){
        layer.msg("Cancel!");
        return 0;
      });
    }

</script>


</body>
</html>
